﻿//医疗机构滚动js代码

//图片滚动列表 mengjia 070816

var Speedh = 10; //速度(毫秒)

var Spaceh = 10; //每次移动(px)

var PageWidthh = 195; //翻页宽度

var fillh = 0; //整体移位

var MoveLockh = false;

var MoveTimeObjh;

var Comph = 0;

var AutoPlayObjh = null;

GetObj("List3").innerHTML;

GetObj("List4").innerHTML;

GetObj('ISL_Conth').scrollLeft = fillh;

GetObj("ISL_Conth").onmouseover = function(){clearInterval(AutoPlayObjh);}

GetObj("ISL_Conth").onmouseout = function(){AutoPlayh();}

AutoPlayh();

function GetObj(objName){if(document.getElementById){return eval('document.getElementById("'+objName+'")')}else{return eval



('document.all.'+objName)}}

function AutoPlayh(){ //自动滚动

clearInterval(AutoPlayObjh);

AutoPlayObjh = setInterval('ISL_GoDownh();ISL_StopDownh();',2000); //间隔时间

}

function ISL_GoUph(){ //上翻开始

if(MoveLockh) return;

clearInterval(AutoPlayObjh);

MoveLockh = true;

MoveTimeObjh = setInterval('ISL_ScrUph();',Speedh);

}

function ISL_StopUph(){ //上翻停止

clearInterval(MoveTimeObjh);

if(GetObj('ISL_Conth').scrollLeft % PageWidthh - fillh != 0){

Comph = fillh - (GetObj('ISL_Conth').scrollLeft % PageWidthh);

CompScrh();

}else{

MoveLockh = false;

}

AutoPlayh();

}

function ISL_ScrUph(){ //上翻动作

if(GetObj('ISL_Conth').scrollLeft <= 0){GetObj('ISL_Conth').scrollLeft = GetObj



('ISL_Conth').scrollLeft + GetObj('List3').offsetWidth}

GetObj('ISL_Conth').scrollLeft -= Spaceh ;

}

function ISL_GoDownh(){ //下翻

clearInterval(MoveTimeObjh);

if(MoveLockh) return;

clearInterval(AutoPlayObjh);

MoveLockh = true;

ISL_ScrDownh();

MoveTimeObjh = setInterval('ISL_ScrDownh()',Speedh);

}

function ISL_StopDownh(){ //下翻停止

clearInterval(MoveTimeObjh);

if(GetObj('ISL_Conth').scrollLeft % PageWidthh - fillh != 0 ){

Comph = PageWidthh - GetObj('ISL_Conth').scrollLeft % PageWidthh + fillh;

CompScrh();

}else{

MoveLockh = false;

}

AutoPlayh();

}

function ISL_ScrDownh(){ //下翻动作

if(GetObj('ISL_Conth').scrollLeft >= (GetObj('List3').scrollWidth)-1350){GetObj('ISL_Conth').scrollLeft =



GetObj('ISL_Conth').scrollLeft - GetObj('List3').scrollWidth;}

GetObj('ISL_Conth').scrollLeft += Spaceh ;

}

function CompScrh(){

var numh;

if(Comph == 0){MoveLockh = false;return;}

if(Comph < 0){ //上翻

if(Comph < -Spaceh){

   Comph += Spaceh;

   numh = Spaceh;

}else{

   numh = -Comph;

   Comph = 0;

}

GetObj('ISL_Conth').scrollLeft -= numh;

setTimeout('CompScrh()',Speedh);

}else{ //下翻

if(Comph > Spaceh){

   Comph -= Spaceh;

   numh= Spaceh;

}else{

   numh = Comph;

   Comph = 0;

}

GetObj('ISL_Conth').scrollLeft += numh;

setTimeout('CompScrh()',Speedh);

}

}

